using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using UnityEngine;

namespace DriverSVH
{
    public struct SVHControlCommand
    {
        //[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
        public int position;

        public SVHControlCommand(int p = 0)
        {
            position = p;
        }
    }

    public struct SVHControlCommandAllChannels
    {
        //! Multiple controllcommands that shall be send at once
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
        public SVHControlCommand[] commands;

        /**
         * \brief Constructs a controllcommand adressing all channels at once All
         * \param _position0 Target position for the Thumb_Flexion
         * \param _position1 Target position for the Thumb_Opposition
         * \param _position2 Target position for the Index_Finger_Distal
         * \param _position3 Target position for the Index_Finger_Proximal
         * \param _position4 Target position for the Middle_Finger_Distal
         * \param _position5 Target position for the Middle_Finger_Proximal
         * \param _position6 Target position for the Ring_Finger
         * \param _position7 Target position for the Pinky
         * \param _position8 Target position for the Finger_Spread
        **/
        public SVHControlCommandAllChannels(int[] _position)
        {
            commands = new SVHControlCommand[]
            {
                new SVHControlCommand(_position[0]),
                new SVHControlCommand(_position[1]),
                new SVHControlCommand(_position[2]),
                new SVHControlCommand(_position[3]),
                new SVHControlCommand(_position[4]),
                new SVHControlCommand(_position[5]),
                new SVHControlCommand(_position[6]),
                new SVHControlCommand(_position[7]),
                new SVHControlCommand(_position[8])
            };
        }

    }

}
